﻿using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x0200002B RID: 43
[RequireComponent(typeof(Image))]
public class ColorImage : MonoBehaviour
{
	// Token: 0x060000DD RID: 221 RVA: 0x0000BE2B File Offset: 0x0000A02B
	private void Awake()
	{
		this.image = base.GetComponent<Image>();
		this.picker.onValueChanged.AddListener(new UnityAction<Color>(this.ColorChanged));
	}

	// Token: 0x060000DE RID: 222 RVA: 0x0000BE55 File Offset: 0x0000A055
	private void OnDestroy()
	{
		this.picker.onValueChanged.RemoveListener(new UnityAction<Color>(this.ColorChanged));
	}

	// Token: 0x060000DF RID: 223 RVA: 0x0000BE73 File Offset: 0x0000A073
	private void ColorChanged(Color newColor)
	{
		this.image.color = newColor;
	}

	// Token: 0x040001E6 RID: 486
	public ColorPicker picker;

	// Token: 0x040001E7 RID: 487
	private Image image;
}
